package com.xigua.chapter_4_FactoryMethod.example.idcard;

import com.xigua.chapter_4_FactoryMethod.example.framework.Factory;
import com.xigua.chapter_4_FactoryMethod.example.framework.Product;

import java.util.ArrayList;
import java.util.List;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/3/3020:19
 */
public class IDCardFactory extends Factory {

    private List owners = new ArrayList();

    public Product createProduct(String owner) {
        return new IDCard(owner);
    }

    public void registerProduct(Product product) {
        owners.add(((IDCard)product).getOwner());
    }

    public List getOwners() {
        return owners;
    }

}
